package com.huawei.appgallery.forum.forum.fragment;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.huawei.appgallery.forum.base.https.jgw.JGWTabDetailResponse;
import com.huawei.appgallery.forum.base.ui.JGWTabFragment;
import com.huawei.appgallery.forum.forum.activity.ForumDetailActivity;
import com.huawei.appgallery.forum.forum.adapter.ForumDetailListAdapter;
import com.huawei.appgallery.forum.forum.api.IForumDetailProtocol;
import com.huawei.appgallery.forum.forum.bean.ForumSectionInfoCardBean;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseDetailResponse.LayoutData;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment;
import com.huawei.appgallery.foundation.ui.framework.cardframe.fragment.TaskFragment.b;
import com.huawei.hmf.annotation.FragmentDefine;
import java.util.List;
import o.bsl;

@FragmentDefine(alias = "forumDetailFragment", protocol = IForumDetailProtocol.class)
public class ForumDetailFragment extends JGWTabFragment {
    private ForumDetailListAdapter ʻˊ;
    private Context ﾞ;

    public void ˏ(Bundle bundle) {
        this.ʼ = new bsl(this, null, ((IForumDetailProtocol) this.ﹳ.ॱ()).getUri());
        super.ˏ(bundle);
    }

    public View ˋ(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        super.ˋ(layoutInflater, viewGroup, bundle);
        this.ﾞ = ॱˋ();
        this.ʻˊ = new ForumDetailListAdapter(this.ﾞ, this.י);
        this.ͺˎ.setAdapter(this.ʻˊ);
        return this.ॱˍ;
    }

    public boolean ˊ(TaskFragment taskFragment, b bVar) {
        boolean ˊ = super.ˊ(taskFragment, bVar);
        if (bVar.ˋ.getResponseCode() == 0 && bVar.ˋ.getRtnCode_() == 0 && (bVar.ˋ instanceof JGWTabDetailResponse)) {
            ˋ((JGWTabDetailResponse) bVar.ˋ);
        }
        return ˊ;
    }

    private void ˋ(JGWTabDetailResponse jGWTabDetailResponse) {
        String ˋ = jGWTabDetailResponse.ˋ();
        if (!TextUtils.isEmpty(ˋ)) {
            ((ForumDetailActivity) this.ﾞ).ˎ(ˋ);
        }
        List<LayoutData> ᐝॱ = jGWTabDetailResponse.ᐝॱ();
        if (ᐝॱ != null && ᐝॱ.size() > 0) {
            for (LayoutData layoutData : ᐝॱ) {
                if ("forumsectioninfocard".equals(layoutData.ˏ()) && layoutData.ˋ().size() != 0) {
                    List ˋ2 = layoutData.ˋ();
                    if (ˋ2 != null && ˋ2.size() > 0) {
                        ˎ(ˋ2);
                        this.ʻˊ.setListSection(ˋ2);
                        return;
                    }
                    return;
                }
            }
        }
    }

    protected void ˎ(List<ForumSectionInfoCardBean> list) {
    }
}
